package edu.sctu.practice.class02.qiuyangyang.text03;

/**
 * Created by Administrator on 2015/10/9 0009.
 */
public class MyTime {
    private int hour;
    private int minute;
    private int second;

    public MyTime(int hour, int minute, int second) {
        this.hour = hour;
        this.minute = minute;
        this.second = second;
    }

    public int addHour() {
        return hour + 2;
    }

    public int addMinute() {
        return minute + 20;
    }

    public int addSecond() {
        return second + 35;
    }

    public int subHour() {
        return hour - 2;
    }

    public int subMinute() {
        return minute - 20;
    }

    public int subSecond() {
        return second - 35;
    }

    public void dispaly() {
        System.out.println("调整前的时间为:" + hour + "时" + minute + "分" + second + "秒");
        System.out.println("调整后的时间为:" + addHour() + "时" + subMinute() + "分" + addSecond() + "秒");
    }
}
